import request from '@/request/request.js'

// 非会员收费规则
export const getCostRules = (params) => {
	return request({
		url: "/weiriya/nonVipSetting/getByMember",
		method: "get",
		data: params,
	})
}

// 会员收费规则
export const getVipCostRules = (params) => {
	return request({
		url: "/weiriya/vipSetting/getByMember",
		method: "get",
		data: params,
	})
}

// 创建支付订单
export const postPayOrder = (params) => {
	return request({
		url: "/weiriya/order",
		method: "post",
		data: params,
	})
}

// 支付
export const getPay = (paymentMethod, paymentClient, params) => {
	return request({
		url: `/payment/cashier/pay/${paymentMethod}/${paymentClient}`,
		method: "get",
		data: params
	})
}

// 取消订单
export const putOrderCancel = (params) => {
	return request({
		url: "/weiriya/order/cancel",
		method: "put",
		data: params,
	})
}

// 开始充电
export const postStartCharge = (params) => {
	return request({
		url: "/weiriya/chargeRecord",
		method: "post",
		data: params,
	})
}

// 查询充电口状态
export const postChargeStatus = (params) => {
	return request({
		url: "/weiriya/chargeRecord/detail/charger",
		method: "post",
		data: params,
	})
}

// 查询充电记录、是否充电中
export const getChargeList = (params) => {
	return request({
		url: "/weiriya/chargeRecord/list",
		method: "get",
		data: params,
	})
}

// 临时开门
export const postDepositRecord = (params) => {
	return request({
		url: "/weiriya/depositRecord",
		method: "post",
		data: params,
	})
}